Test is not throwing error when expect is inside a loop

welcome to shbcf.ru